< previous page page_139 next page >

Page 139
   sh.wFunc = FO_COPY
   sh.pFrom = src$
   sh.pTo = dest$
   sh.fFlags = FOF_RENAMEONCOLLISION Or FOF_SIMPLEPROGRESS
   sh.hNameMappings = 0
    sh.lpszProgressTitle = "Files are being copied to floppy"

   res = SHFileOperation(sh)
   If res <> 0 Then
      MsgBox "Error occurred: " & GetErrorString(Err.LastDllError)
   End If

End Sub
The copy operation is specified by setting the wFunc field of the structure to FO_COPY. The FOF_RENAMEONCOLLISION forces a file rename if a file by the same name already exists on the disk. The FOF_SIMPLEPROGRESS flag indicates that the progress dialog box should just show the message "Files are being copied to floppy" without displaying the individual file names.
Results
The files you drop on the list box do appear on the list box, but no copy operation occurs. What's more, when you close the application, it crashes with a memory exception on Windows NT.
Your job is to fix the program so that it will work under Windows NT.

 
< previous page page_139 next page >